/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package compiladorsc;

/**
 *
 * @author dhabyx
 */
public class token {
    private int col;
    private int row;
    private String cadena;
    private int entero;
    private double decimal;
    private boolean boleano;
    private int tipo;
    public token(){
        
    }
    public token(int col, int row, String cadena, int tipo ) {
        this.tipo=tipo;
        this.col = col;
        this.row = row;
        this.cadena = cadena;
        switch (tipo)
        {
            case 1: this.entero = Integer.parseInt(cadena);break;
            case 2: this.decimal = Double.parseDouble(cadena);break;
            case 3: {if("verdadero".equals(cadena))
                        {
                            this.boleano=true;
                        }
                     else if("falso".equals(cadena))
                        {
                            this.boleano=false;
                        }
            break;
                }
                
        }
    }
    
    public token(int col, int row, String cadena ) {
        this.col = col;
        this.row = row;
        this.cadena = cadena;
        this.tipo=0;
    }
    
    public int getCol() {
        return this.col;
    }
    
    public int getRow() {
        return this.row;
    }
    
    public String getCadena() {
        return this.cadena;
    }
    
    public int getEntero() {
        return this.entero;
    }
    public double getDecimal(){
        return this.decimal;
    }
    public boolean getBoleano() {
        return this.boleano;
    }
    public int getTipo()
    {
        return this.tipo;
    }
}
